<?php
/**
 * Created by PhpStorm.
 * User: alexey
 * Date: 4/21/14
 * Time: 12:16 PM
 */
include_once("functions/db_manipulate.php");

if (!init()) {
  redirect("?action=login");
  exit();
}

$usersResultSet = getLastVisits();

?>
<meta charset="UTF-8">

<div class="userscontent">
  <div class="blockheader">
    Посещения за сегодня:
  </div>

  <?php
  while ($user = mysql_fetch_assoc($usersResultSet)) {
    ?>
    <div class="user" onclick="location.href='?profile&uid=<?= $user['id'] ?>'">
      <div class="usertd">
        <?= $user['nick'] ?>
      </div>
      <div class="usertd">
        <?= $user['visitdate'] ?>
      </div>
      <div class="usertd">
        <?= $user['visittime'] ?>
      </div>

    </div>
  <?
  }
  ?>

  <br>

  <div class="blockuserbutton" onclick="location.href='?action=expvisits'">Экспорт</div>
  <div class="blockuserbutton" onclick="location.href='?action=expallvisits'">Экспорт всех</div>

</div>